package com.advert.exception;

public class AuthenticationException extends ApplicationBusinessException {
    private Reason reason;
    private Integer loginAttempts;

    public AuthenticationException(Reason reason) {
        this.reason = reason;
    }

    public AuthenticationException(Reason reason, Integer loginAttempts) {
        this.reason = reason;
        this.loginAttempts = loginAttempts;
    }


    public Reason getReason() {
        return reason;
    }

    public Integer getLoginAttempts() {
        return loginAttempts;
    }


    public static enum Reason {
        NO_SUCH_LOGIN,
        PASSWORD_INCORRECT,
        USER_NOT_ACTIVE,
        ACTIVATION_INVALID,
        LOGIN_ALREADY_EXISTS,
        NO_SUCH_LOGIN_OR_MAIL
    }
}
